﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using WeiboPlus.Service;
using WeiboPlus.Models;

namespace WeiboPlus.Sina
{
    public class SinaMappingFactory : MappingFactoryBase
    {
        public SinaMappingFactory(SNSAccount account)
            : base(account)
        {

        }

        protected override void RegisterMapping()
        {
            var statusMapping = new SinaJTokenToStatusMapping(this);
            if (!_mappings.ContainsKey(statusMapping.IdentifyName))
                _mappings.Add(new KeyValuePair<string, IMapping>(statusMapping.IdentifyName, statusMapping));
            
            var userMapping = new SinaJTokenToUserMapping(this);
            if (!_mappings.ContainsKey(userMapping.IdentifyName))
                _mappings.Add(new KeyValuePair<string, IMapping>(userMapping.IdentifyName, userMapping));

            var friendshipMapping = new SinaJTokenToFriendshipMapping(this);
            if (!_mappings.ContainsKey(friendshipMapping.IdentifyName))
                _mappings.Add(new KeyValuePair<string, IMapping>(friendshipMapping.IdentifyName, friendshipMapping));

            var countsMapping = new SinaJTokenToCountMapping(this);
            if (!_mappings.ContainsKey(countsMapping.IdentifyName))
                _mappings.Add(new KeyValuePair<string, IMapping>(countsMapping.IdentifyName, countsMapping));
            //var commentMapping = new SinaJTokenToCommentMapping(this);
            //if (!_mappings.ContainsKey(commentMapping.IdentifyName))
            //    _mappings.Add(new KeyValuePair<string, IMapping>(commentMapping.IdentifyName, commentMapping));
            var trendsMapping = new SinaJTokenToTrendsMapping(this);
            if (!_mappings.ContainsKey(trendsMapping.IdentifyName))
                _mappings.Add(new KeyValuePair<string, IMapping>(trendsMapping.IdentifyName, trendsMapping));

            var trendMapping = new SinaJTokenToTrendMapping(this);
            if (!_mappings.ContainsKey(trendMapping.IdentifyName))
                _mappings.Add(new KeyValuePair<string, IMapping>(trendMapping.IdentifyName, trendMapping));

        }
    }
}
